import requests
from lxml import etree
# url = 'http://www.zishazx.com/product?page=1&size_id=3&volum_id=3&price_id=2&category_id=0&prize_id=1&pug_id=1'

url = 'http://www.zishazx.com/product?page=1&size_id=0&volum_id=0&price_id=0&category_id=0&prize_id=0&pug_id=0#views'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
    'Referer': 'http://www.zishazx.com/product?page=1&size_id=2&volum_id=0&price_id=0&category_id=0&prize_id=0&pug_id=0',
}
# 携带的get传参
params = {
    'page': '1',
    'size_id': '3',
    'volum_id': '3',
    'price_id': '2',
    'category_id': '0',
    'prize_id': '1',
    'pug_id': '1',
}

# res = requests.get(url, headers=headers, params=params)
# res = requests.get(url, headers=headers)
# print(res.text)
# with open('zszx.html', 'w', encoding='UTF-8') as f:
#     f.write(res.text)

with open('zszx.html', 'r', encoding='UTF-8') as f:
    html = f.read()

tree = etree.HTML(html)
li_list = tree.xpath('//ul[@class="list clearfix"]/li')
# print(li_list)
for li in li_list:
    print(li.xpath('./p[@class="name"]/text()')[0])
    print(li.xpath('./p[@class="p_no"]/text()')[0])